import time
import pytest
import os
import smtplib
from email.mime.text import MIMEText
from email.header import Header
from sendEmil import SendEmail

if __name__ == '__main__':
    # os.system("pytest -sq Test_excel.py --alluredir=./report")
    # time.sleep(2)
    # os.system("allure serve ./report")
    send = SendEmail()
    send.send163()
    # # 发信⽅的信息：发信邮箱， QQ邮箱授权码
    # from_addr = '2528922280@qq.com'
    # password = '1965302350yao'
    # to_addr = '13552648187@163.com'
    # smtp_server = 'smtp.qq.com'
    # html_msg = """
    #  <p>Python 邮件发送HTML 格式⽂件测试...</p>
    #  <p><a href="http://192.168.53.1:54025/index.html">这是⼀个链接</a></p>
    # """
    # msg = MIMEText(html_msg, 'html', 'utf-8')
    # # 邮件头信息
    #
    # msg['From'] = Header('2528922280@qq.com')
    # msg['To'] = Header('13552648187@163.com')
    # subject = 'Python SMTP邮件测试'
    # msg['Subject'] = Header(subject, 'utf-8')
    # try:
    # # 建⽴连接 - -qq邮箱服务和端⼝号（可百度查询）
    #
    #     with smtplib.SMTP_SSL(smtp_server, 465) as smtpobj:
    # # 登录 - -发送者账号和⼝令
    #
    #         smtpobj.login(from_addr, password)
    # # 发送邮件
    #
    #         smtpobj.sendmail(from_addr, to_addr, msg.as_string())
    #     print("邮件发送成功")
    # except Exception as e:
    #     print("⽆法发送邮件 \ : ", e)







